package cl.usm.test;

public class DarkVaderProxy implements cl.usm.test.DarkVader {
  private String _endpoint = null;
  private cl.usm.test.DarkVader darkVader = null;
  
  public DarkVaderProxy() {
    _initDarkVaderProxy();
  }
  
  public DarkVaderProxy(String endpoint) {
    _endpoint = endpoint;
    _initDarkVaderProxy();
  }
  
  private void _initDarkVaderProxy() {
    try {
      darkVader = (new cl.usm.test.DarkVaderServiceLocator()).getDarkVader();
      if (darkVader != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)darkVader)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)darkVader)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (darkVader != null)
      ((javax.xml.rpc.Stub)darkVader)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public cl.usm.test.DarkVader getDarkVader() {
    if (darkVader == null)
      _initDarkVaderProxy();
    return darkVader;
  }
  
  public java.lang.String saludeDonDark() throws java.rmi.RemoteException{
    if (darkVader == null)
      _initDarkVaderProxy();
    return darkVader.saludeDonDark();
  }
  
  
}